/**
 * @(#)AdDaoImpl.java 2017年4月6日
 * Copyright(C) 2017 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao.impl;

import java.util.List;

import org.jsbd.boss.dao.IAdDAO;
import org.jsbd.boss.domian.channel.Ad;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * TODO 请加入本类的说明
 * 
 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
 * @version 1.0.0
 */
@Service
public class AdDaoImpl extends CrackBaseDao implements IAdDAO {
	public static final Logger LOGGER = LoggerFactory.getLogger(AdDaoImpl.class);

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jsbd.boss.dao.IAdDAO#selectAdList(java.lang.Integer,
	 * java.lang.Integer)
	 */
	@Override
	public List<Ad> selectAdList(Integer length) {
		return super.queryForList("qy_ad.SELECT_AD_LIST", length);
	}

	@Override
	public List<Ad> selectPageAdList(Ad ad) {
		return super.queryForList("qy_ad.SELECT_PAGE_LIST", ad);
	}

	@Override
	public Integer insertAd(Ad ad) {
		return (Integer) super.insert("qy_ad.INSERT_AD", ad);
	}

	@Override
	public Integer updateAd(Ad ad) {
		return (Integer) super.update("qy_ad.UPDATE_AD", ad);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jsbd.boss.dao.IAdDAO#selectAd(org.jsbd.boss.domian.channel.Ad)
	 */
	@Override
	public Ad selectAd(Ad ad) {
		return (Ad) super.queryForObject("qy_ad.SELECT_AD", ad);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.jsbd.boss.dao.IAdDAO#selectCountOfAd(org.jsbd.boss.domian.channel.Ad)
	 */
	@Override
	public Integer selectCountOfAd(Ad ad) {
		return super.queryForCount("qy_ad.SELECT_COUNT", ad);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jsbd.boss.dao.IAdDAO#selectAllAdList(java.lang.Integer)
	 */
	@Override
	public List<Ad> selectAllAdList() {
		return super.queryForList("qy_ad.SELECT_ALL_LIST");
	}

	@Override
	public List<Ad>  selectAllUsefulAd() {
		return super.queryForList("qy_ad.SELECT_ALLUSEFULl_LIST");
	}
	
}
